<template>
  <div id="app">
    <router-view/>
    <Fade>
      <Layer :msg="msg" v-show="show"></Layer>
    </Fade>
    <Navbar></Navbar>
  </div>
</template>

<script>
  import Navbar from '@/components/navbar/Navbar.vue'
  import Layer from '@/components/layer/Layer.vue'
  import Fade from '@/components/fade/Fade.vue'
  export default {
    name: 'App',
    components: {
      Navbar,
      Fade,
      Layer
    },
    created() {
      this.$bus.$on('tip', msg => {
        this.msg = msg
        if(this.show) {
          return
        }
        this.show = true
        setTimeout(()=> {
          this.show = false
        }, 2000)
      })
    },
    data() {
      return {
        msg: '提示',
        show: false
      }
    }
  }
</script>

<style lang="scss">
#app {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  // color: #2c3e50;
  color: #000000;
  min-height: 100%;
}

</style>
